package com.example.zhinongbao.Model;

import android.content.Context;

import com.example.zhinongbao.database.UserInfoDao;
import com.example.zhinongbao.entity.Cart;
import com.example.zhinongbao.entity.Goods;

import java.util.List;


public class ShoppingCartImpl implements IShoppingCart {
    private UserInfoDao userInfoDao ;
    public ShoppingCartImpl(Context context){
        userInfoDao = new UserInfoDao(context);
    }
    @Override
    public List<Cart> getCartByPhone() {
        return userInfoDao.getCartByPhone();
    }

    @Override
    public void deleteCartById(int id) {
        userInfoDao.deleteCartById(id);
    }

    @Override
    public Cart getCartById(int id) {
        return userInfoDao.getCartById(id);
    }

    @Override
    public void updateCartNumById(int id, int num) {
        userInfoDao.updateCartNumById(id, num);
    }

    @Override
    public Goods getGoodsById(int id) {
        return userInfoDao.getGoodsById(id);
    }

//    @Override
//    public int getLocalDefaultId() {
//        return userInfoDao.getLocalDefaultId();
//    }

//    @Override
//    public void addOrUpdateFoot(int goodsId, String user, String time) {
//        userInfoDao.addOrUpdateFoot(goodsId, user, time);
//    }
}
